/**
 * Created by chenweicheng on 1/3/2017.
 */
/**
 * Created by Administrator on 2016/12/20 0020.
 */

import React, {Component} from 'react';
import {AppRegistry, View, Text, ScrollView, Image, StyleSheet, TouchableHighlight} from 'react-native';
import TextToSpeechManager from '../TextToSpeechManager';

export default class TestTextToSpeechManager extends Component {

    constructor(props) {
        super(props)
        this.state = {requetResult: ''}
    }

    handleTTS() {
        TextToSpeechManager.textToSpeech("我是帅哥我是帅哥我是帅哥我是帅哥我是帅哥我是帅哥").then((result) => {
            console.log("speak success");
        }, (error) => {
            console.log("speak fail" + error)
        });

    }

    render() {
        return (
            <View style={styles.container}>
                <TouchableHighlight style={{padding: 20, backgroundColor: '#ccc'}}
                                    onPress={() =>this.handleTTS()  }>
                    <Text>TextToSpeech</Text>
                </TouchableHighlight>


            </View>
        );
    }
}
var styles = StyleSheet.create({
    container: {
        //   justifyContent: 'center',
        flex: 1,
        flexDirection: 'column',//没有flexDirection这个属性的话，justifyContent不会生效
        justifyContent: 'center',
        padding: 15,
        alignItems: 'center'
    }
});
AppRegistry.registerComponent('TestTextToSpeechManager', () => TestTextToSpeechManager);